using UnityEditor;

namespace Hydrogen.MarkovChain.SolidMap2DScene.Editor
{
    [CustomEditor(typeof(SolidTile))]
    public class SolidTileEditor : UnityEditor.Editor
    {
        protected SolidTile _tile => target as SolidTile;

        public override void OnInspectorGUI()
        {
            base.OnInspectorGUI();

            EditorGUILayout.Space();
            EditorGUI.BeginChangeCheck();
            this._tile.Type = (SolidType)EditorGUILayout.EnumPopup("SolidType",this._tile.Type);
            if (EditorGUI.EndChangeCheck())
            {
                serializedObject.ApplyModifiedProperties();
                EditorUtility.SetDirty(target);
            }
        }
    }
}